package point24.model;

import point24.util.AISearcherImp;
import point24.util.RandomSearcherImp;
import point24.util.Searcher;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Vector;

public class GameModel {
    private Integer[] numbers;
    private List<String> resultList;
    private Searcher searcher = new AISearcherImp();

    public GameModel() {
        numbers = new Integer[]{1, 1, 1, 1};
        resultList = new Vector<>();

    }

    public Integer[] getNumbers() {
        return numbers;
    }

    public void setNumbers(Integer[] numbers) {
        Arrays.sort(numbers);
        this.numbers = numbers;
    }

    public List<String> getResult() {
        return resultList;
    }

    public void setResult(List<String> resultList) {
        Collections.sort(resultList);
        this.resultList = resultList;

    }

    public void calculate() {
        resultList = searcher.search(numbers);

    }
}
